Fix SCHEDOP_poll to avoid wakeup-waiting race on interrupt delivery.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 16 Oct 2008 17:36:43 +0000 (18:36 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 16 Oct 2008 17:36:43 +0000 (18:36 +0100)
Race found by Jan Beulich.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/schedule.c

index 12882d02046a3a7e0ccbc682f3285df058ca30fc..04b09e2168841150f2072543aa06dc37ff6ed792 100644 (file)
@@ -455,6 +455,10 @@ static long do_poll(struct sched_poll *sched_poll)
         goto out;
 #endif
 
+    rc = 0;
+    if ( local_events_need_delivery() )
+        goto out;
+
     for ( i = 0; i < sched_poll->nr_ports; i++ )
     {
         rc = -EFAULT;